package com.gopay.common.domain.dps;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;


@Entity
@Table(name = "WA_CERTIFICATE")
public class WaCertificate implements Serializable {
	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = -1069031394650363880L;
	
	/**
	 * 用户数字证书表主键
	 */
	@Id
	@SequenceGenerator(name = "CUST_CA_CERT_SEQ_GENERATOR", sequenceName = "CUST_CA_CERT_SEQ", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "CUST_CA_CERT_SEQ_GENERATOR")
	@Column(name = "ID")
	private Long id;
	
	/**
	 * 客户ID
	 */
	@Column(name="CUST_ID")
	private String custId;

	/**
	 * 用户ID
     */
	@Column(name = "USER_ID")
	private String userId;

	/**
	 * 设备ID
     */
	@Column(name = "DEVICE_ID")
	private String deviceId;
	
	/**
	 * 购买记录ID
     */
	@Column(name= "BUY_DTL_ID")
	private String buyDtlId;

	/**
	 * 客户类型（个人:1、企业:2）
	 */
	@Column(name="CUST_TYPE")
	private String custType;
	
	/**
	 * 证书名称
	 */
	@Column(name="CERT_NAME")
	private String certName;
	
	/**
	 * 用户证书存放地址
	 */
	@Column(name="CERT_URL")
	private String certUrl;

	/**
	 * 描述
	 */
	@Column(name="DESCS")
	private String descs;
	
	/**
	 * 状态（01：启用, 02：关闭,03：过期）
	 */
	@Column(name="STAT")
	private String stat;
	
	/**
	 * 操作人
	 */
	@Column(name="LAST_UPT_OPER_ID")
    private String lastUptOperId;
	
	/**
	 * 启用时间
	 */
	@Column(name="VALID_FROM")
    private Date validFrom;
	
	/**
	 * 过期时间
	 */
	@Column(name="VALID_TO")
    private Date validTo;
	
	/**
	 * 操作时间
	 */
	@Column(name="LAST_UPT_TS")
    private Date lastUptTs;
	
	/**
	 * 乐观锁版本号
	 */
	@Column(name="VERSION")
    private int version;
	/**
	 * 证书颁发者
	 */
	@Column(name="ISSUER")
    private String isSuer;
	
	/**
	 * 证书服务提供商
	 */
	@Column(name="CSP")
    private String csp;
	
	/**
	 * 密钥容器名
	 */
	@Column(name="KEY_CONTAINER")
    private String keyContainer;
	
	/**
	 * 证书序列号
	 */
	@Column(name="SN")
    private String sn;
	/**
	 * 证书公钥
	 */
	@Column(name="PUBLIC_KEY")
    private String publicKEY;
	/**
	 * 证书内容
	 */
	@Column(name="CERT_CONTENT")
    private String certContent;

	/**
	 * 证书购买（赠送）日期
     */
	@Column(name = "CA_BUY_TS")
	private Date caBuyTs;

	/**
     * 证书类型 
     */
    @Column(name="CERT_TYPE")
    private String certType;
    
    /**
     * 创建时间
     */
    @Column(name="CREATED_TS")
    private Date createTime;
    
    /**
     * 证书安装状态
     */
    @Column(name="CERT_INSTALL_STAT")
    private String certInstallStat;
    
    /**
     * add by liuxuyang 添加设备类型 20171206
     */
    @Column(name="PHONE_MODEL")
    private String phoneModel;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCustId() {
		return custId;
	}

	public void setCustId(String custId) {
		this.custId = custId;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getBuyDtlId() {
		return buyDtlId;
	}

	public void setBuyDtlId(String buyDtlId) {
		this.buyDtlId = buyDtlId;
	}

	public String getCustType() {
		return custType;
	}

	public void setCustType(String custType) {
		this.custType = custType;
	}

	public String getCertName() {
		return certName;
	}

	public void setCertName(String certName) {
		this.certName = certName;
	}

	public String getCertUrl() {
		return certUrl;
	}

	public void setCertUrl(String certUrl) {
		this.certUrl = certUrl;
	}

	public String getDescs() {
		return descs;
	}

	public void setDescs(String descs) {
		this.descs = descs;
	}

	public String getStat() {
		return stat;
	}

	public void setStat(String stat) {
		this.stat = stat;
	}

	public String getLastUptOperId() {
		return lastUptOperId;
	}

	public void setLastUptOperId(String lastUptOperId) {
		this.lastUptOperId = lastUptOperId;
	}

	public Date getValidFrom() {
		return validFrom;
	}

	public void setValidFrom(Date validFrom) {
		this.validFrom = validFrom;
	}

	public Date getValidTo() {
		return validTo;
	}

	public void setValidTo(Date validTo) {
		this.validTo = validTo;
	}

	public Date getLastUptTs() {
		return lastUptTs;
	}

	public void setLastUptTs(Date lastUptTs) {
		this.lastUptTs = lastUptTs;
	}

	public int getVersion() {
		return version;
	}

	public void setVersion(int version) {
		this.version = version;
	}

	public String getIsSuer() {
		return isSuer;
	}

	public void setIsSuer(String isSuer) {
		this.isSuer = isSuer;
	}

	public String getCsp() {
		return csp;
	}

	public void setCsp(String csp) {
		this.csp = csp;
	}

	public String getKeyContainer() {
		return keyContainer;
	}

	public void setKeyContainer(String keyContainer) {
		this.keyContainer = keyContainer;
	}

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getPublicKEY() {
		return publicKEY;
	}

	public void setPublicKEY(String publicKEY) {
		this.publicKEY = publicKEY;
	}

	public String getCertContent() {
		return certContent;
	}

	public void setCertContent(String certContent) {
		this.certContent = certContent;
	}

	public Date getCaBuyTs() {
		return caBuyTs;
	}

	public void setCaBuyTs(Date caBuyTs) {
		this.caBuyTs = caBuyTs;
	}

	public String getCertType() {
		return certType;
	}

	public void setCertType(String certType) {
		this.certType = certType;
	}

	public String getDeviceId() {
		return deviceId;
	}

	public void setDeviceId(String deviceId) {
		this.deviceId = deviceId;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public String getCertInstallStat() {
		return certInstallStat;
	}

	public void setCertInstallStat(String certInstallStat) {
		this.certInstallStat = certInstallStat;
	}
	
	public String getPhoneModel() {
		return phoneModel;
	}

	public void setPhoneModel(String phoneModel) {
		this.phoneModel = phoneModel;
	}

	@Override
	public String toString() {
		return "WaCertificate [id=" + id + ", custId=" + custId + ", userId=" + userId + ", deviceId=" + deviceId
				+ ", buyDtlId=" + buyDtlId + ", custType=" + custType + ", certName=" + certName + ", certUrl="
				+ certUrl + ", descs=" + descs + ", stat=" + stat + ", lastUptOperId=" + lastUptOperId + ", validFrom="
				+ validFrom + ", validTo=" + validTo + ", lastUptTs=" + lastUptTs + ", version=" + version + ", isSuer="
				+ isSuer + ", csp=" + csp + ", keyContainer=" + keyContainer + ", sn=" + sn + ", publicKEY=" + publicKEY
				+ ", certContent=" + certContent + ", caBuyTs=" + caBuyTs + ", certType=" + certType + ", createTime="
				+ createTime + ", certInstallStat=" + certInstallStat + "]";
	}
    
}
